package represent.type;

import java.sql.Timestamp;

import utils.Lib;

public class TimeStampType implements Type {

	private Long val;
	
	public TimeStampType(Timestamp s) {
		val = s.getTime();
	}
	
	public TimeStampType(long l) {
		val = l;
	}

	public Object asJavaVal() {
		// TODO �Զ���ɷ������
		return null;
	}

	public Type divide(Type c) {
		Lib.assertNotReached();
		return null;
	}

	public String getType() {
		// TODO �Զ���ɷ������
		return "timestamp";
	}

	public Type minus(Type c) {
		Lib.assertNotReached();
		return null;
	}

	public Type mod(Type c) {
		Lib.assertNotReached();
		return null;
	}

	public Type mult(Type c) {
		Lib.assertNotReached();
		return null;
	}

	public Type plus(Type constant) {
		Lib.assertNotReached();
		return null;
	}

	public int compareTo(Type arg0) {
		// TODO
		return 0;
	}
	
//	public boolean equals(Object o) {
//		return true;
//	}

	public static int compare(byte[] a, byte[] b) {
		// TODO
		return 0;
	}

	public static TimeStampType fromBytes(byte[] bytes) {
		// TODO
		return null;
	}
	
	public int TypeToInt() {
		return utils.Constant.TIMESTAMP;
	}
	
	public static int length() {
		return 8;	// long
	}
	
}
